package com.zretc.common.encoder;

import com.alibaba.fastjson.JSON;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class WebServerEncoder implements Encoder.Text<Object> {

    @Override
    public void destroy() {
    }

    @Override
    public void init(EndpointConfig arg0) {

    }

    @Override
    public String encode(Object obj) throws EncodeException {
            return JSON.toJSONString(obj);
        }


}